package com.stars.services.impl.system;
import com.github.pagehelper.PageInfo;
import com.stars.entity.system.SysAppEntity;
import com.stars.services.system.SysAppAccessServices;
import com.stars.dao.mapper.system.SysAppMapper;
import com.stars.entity.dto.system.SysAppDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 系统app管理 业务逻辑
 * @author dj
 * @date 2019-10-12 18:11:37
 * @version V1.0
 *
 */
@Service
public class SysAppAccessServicesImpl  extends BaseAccessServiceImpl<SysAppMapper , SysAppEntity> implements  SysAppAccessServices {
    @Autowired
    private SysAppMapper  sysAppMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<SysAppDTO> pageList(Integer pageNum, Integer pageSize, SysAppDTO dto) throws Exception{
        ListPage<SysAppDTO> listPage = new ListPage<>(pageNum, pageSize, dto);
        PageHelper.startPage(pageNum, pageSize);
        List<SysAppDTO> list = sysAppMapper.pageQuerySysApp(listPage);
        PageInfo<SysAppDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
